﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ECOSYSTEMPRESENTACION
{
    public partial class frmLogin : Form
    {
        public frmLogin()
        {
            InitializeComponent();
        }

        private void tmrReloj_Tick(object sender, EventArgs e)
        {
            DateTime hora = DateTime.Now;
            txtFecHor.Text = "Hoy es : " + hora.Day.ToString() + " / " + hora.Month.ToString() + " / " + hora.Year.ToString() + "         " + hora.ToLocalTime().ToLongTimeString().ToString();
        }

        private void btnIngresar_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            frmPrincipal principal = new frmPrincipal();
            principal.Show();
            principal.lblUsuarioLogin.Text = "USUARIO : "+txtNameUsu.Text;
        }

        private void frmLogin_Load(object sender, EventArgs e)
        {
            txtNameUsu.Select();
        }

        private void txtNameUsu_KeyPress(object sender, KeyPressEventArgs e)
        {
            NextTAB(e);
        }
        private void NextTAB(KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)(Keys.Enter))
            {
                e.Handled = true;
                SendKeys.Send("{TAB}");
            }
        }

        private void txtContraUsu_KeyPress(object sender, KeyPressEventArgs e)
        {
            NextTAB(e);
        }

        private void btnIngresar_KeyPress(object sender, KeyPressEventArgs e)
        {
            NextTAB(e);
        }

        private void btnSalir_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
